<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@page import="com.ares.service.bean.BeanObjetivo" %>
<%@page import="com.ares.service.bean.BeanMeta" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <title>Sistema Gestión de Desempeño</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />-->
        <link href="<%=request.getContextPath()%>/css/miestilo.css" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.3.min.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/js/js/util.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/js/js/sevde.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/js/js/prototype.js"></script>
    </head>

    <body
        onunload="
                    javascript:window.opener.document.getElementById('btnGrabar').disabled=false;
                    javascript:window.opener.document.getElementById('btnEnviar').disabled=false;
                    javascript:window.opener.document.getElementById('btnImprimir').disabled=false;
                    javascript:window.opener.document.getElementById('btnCerrar').disabled=false;
    				javascript:window.opener.cerrar_popup();
            ">
  
            <input type="hidden" name="method" />
            <input type="hidden" name="valor" />
            <table border=0>
                <tr>
                    <td style="background: #1F497D ; color: #ffffff " class="labelCampos" >
                        Indicar motivo de rechazo : 
                    </td>
                </tr>

                <tr>
                    <td>
                        <textarea cols="62" rows="10" id="txtMotivoSolicitud"   class="textarea"></textarea>
                        <!--html:textarea cols="62" rows="10" property="strdesobjetivo" styleId="strdesobjetivo"  onkeydown="valida_longitud()" onkeyup="valida_longitud()" styleClass="textarea" >/html:textarea-->
                    </td>
                </tr>

      

                <tr >
                    <td>
                        <input type="button" value="Aceptar" style="background:#AAAAAA" onclick="agregar();" />
                        <input type="button" value="Cancelar" style="background:#AAAAAA" onclick="cerrar();" />
                    </td>
                     <td >
                        
                    </td>
                </tr>
            </table>


        <script type="text/javascript">  
		        function TextAreaVacio(Objeto){
			   		 var text=document.getElementById(Objeto).value;
			   		 //Si quieres que funcione con Windows, Unix y Mac rompe estilo de línea utilizar esto: text.replace(/\r?\n|\r/g, ""); 
			   		 text=text.replace(/\r?\n|\r/g, ""); 
			   		 if(allTrim(text)=="")return "v"; else return "f";
		   	 	}
		        function agregar(){
		        	if(TextAreaVacio("txtMotivoSolicitud")=="v"){
		        		alert("Debe de indicar un motivo para el rechazo");	 
		        		document.getElementById("txtMotivoSolicitud").focus();
		        	 }else{
		        		window.opener.document.getElementById("txtMotivoSolicitud").value=document.getElementById("txtMotivoSolicitud").value;
		        		javascript:window.opener.rechazar('<%=request.getContextPath()%>');
		        		window.close();
		        	 }
		        }
				function cerrar(){
					javascript:window.opener.document.getElementById('btnGrabar').disabled=false;
	                javascript:window.opener.document.getElementById('btnEnviar').disabled=false;
	                javascript:window.opener.document.getElementById('btnImprimir').disabled=false;
	                javascript:window.opener.document.getElementById('btnCerrar').disabled=false;
					javascript:window.opener.cerrar_popup();
					window.close();
				}
        </script>
    </body>
</html>
